package com.nf.xiaomi.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.nf.dbutils.Column;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@ToString
public class ProductEntity {
//    产品表
    @Column("product_id")
    private Integer productID;
    @Column("detail_id_list")
    private String detailIdList;
    @Column("category_id")
    private Integer categoryID;
    @Column("product_name")
    private String productName;
    @Column("product_price")
    private BigDecimal productPrice;
    @Column("product_picture")
    private String productPictureList;
    @Column("product_describe")
    private String productDescribe;
    @Column("product_date")
    @JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GTM+8")
    private LocalDateTime productDate;
    @Column("product_amount")
    private Integer productAmount;
    @Column("nstate")
    private Integer state;
    public String getStatusText(){
        return this.state==1?"上架":"下架";
    }
    //    分类名
    @Column("category_name")
    private String categoryName;
//    产品明细
    @Column("product_detail_id")
    private Integer productDetailID;
    @Column("attribute_id")
    private Integer attributeID;
    @Column("attribute_list")
    private String attributeList;
    @Column("product_detail_picture")
    private String productDetailPicture;
    @Column("product_detail_price")
    private BigDecimal productDetailPrice;
    @Column("product_detail_amount")
    private Integer productDetailAmount;
}
